package com.liang.book.service;

import com.liang.book.mapper.BuyMapper;
import com.liang.book.model.AddBuyBook;
import com.liang.book.model.Purchase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BuyService {
    @Autowired
    private BuyMapper buyMapper;
    public Integer insertPurchaseDetail(Purchase purchase) {
        return buyMapper.insertPurchaseDetail(purchase);
    }
    public Purchase selectPurchaseDetail(Integer id) {
        return buyMapper.selectPurchaseDetail(id);
    }

    public Integer addBuyBook(AddBuyBook addBuyBook) {
        return buyMapper.addBuyBook(addBuyBook);
    }

    public List<AddBuyBook> selectAddBook(String buyerName) {
        return buyMapper.selectAddBook(buyerName);
    }

    public List<Purchase> selectPurchaseList(String buyerName) {
        return buyMapper.selectPurchaseList(buyerName);
    }

    public Integer insertPurchase(Purchase purchase) {
        return buyMapper.insertPurchase(purchase);
    }
}
